<template>
	<view class="content">

		<view class="topBj"></view>

		<view class="middle">
			<view class="" v-for="(item, idx) in list" @click="show(item.id, item.name)">
				<view class="image">
					<image :src="item.imgs" mode=""></image>
				</view>
			</view>
		</view>

		<view class="flower" @click="xcxcs">
			<image :src="location + '/new_app/activity/nationalDay/flower.png'" mode=""></image>
		</view>

	</view>
</template>
<script>
	export default {
		data() {
			return {
				user: uni.getStorageSync("member"),
				location: 'https://oss.boyaltd.cn',
				list: [],
				touchNum: 0,
			}
		},
		onLoad(opt) {
			let self = this;
			uni.showLoading({
				title: '加载中...'
			});
			self.get_list();
		},
		methods: {
			get_list() {
				var self = this
				self.$boya.Request({
					url: '/activity/article',
					data: {
						type: 23,
					}
				}, function(res) {
					uni.hideLoading();
					let data = res.data.data
					console.log('data: ', data);
					for (var i = 0; i < data.length; i++) {
						if (data[i].imgs) {
							let img = data[i].imgs.substring(2, data[i].imgs.length - 2);
							data[i].imgs = img
						}
					}
					self.list = data
				}, false)
			},
			show(id, name) {
				let self = this
				uni.navigateTo({
					url: 'exhibition?id=' + id + '&name=' + name
				})
			},
			xcxcs() {
				let self = this
				self.touchNum++
				setTimeout(() => {
					if (self.touchNum >= 3) {
						let appid = "gh_9ac906421a76";
						let path = "pages/ticket/custom-poster/custom-poster?customId=11540&tj_bm_user_id=1153446&source=official_shop&hid=189820&zkt_scene=sale&zkt_sign=1-c2669763e067bfc95ec192979d564740&fs=221852266"
						uni.hideLoading();
						// #ifdef H5
						console.log("H5H5H5H5H5H5H5H5");
						uni.webView.postMessage({
							data: {
								type: "open_wexin",
								data: {
									app_id: appid,
									path: path
								}
							},
						})
						// #endif
						// #ifdef APP-PLUS
						console.log("APP-PLUSAPP-PLUSAPP-PLUS");
						sweixin ? sweixin.launchMiniProgram({
							id: appid,
							path: path
						}) : plus.nativeUI.alert('当前环境不支持微信操作!');
						// #endif
					}
					self.touchNum = 0
				}, 350)
			}
		},
	}
</script>

<style>
	.content {
		width: 100vw;
		min-height: 100vh;
		background: url('https://oss.boyaltd.cn/new_app/activity/nationalDay/bottom.png') 100% 100% / 100% 100%;
	}

	.topBj {
		width: 100vw;
		height: 298rpx;
		background: url('https://oss.boyaltd.cn/new_app/activity/nationalDay/top.png') 100% 100% / 100% 100%;
	}

	.middle {
		width: 88%;
		margin: 0 auto;
	}

	.image {
		width: 98%;
		height: 195rpx;
		margin: 25rpx 0;
	}

	.image>image {
		width: 100%;
		height: 100%;
	}

	.flower {
		position: absolute;
		right: 15rpx;
		bottom: 5rpx;
		width: 135rpx;
		height: 235rpx;
	}

	.flower>image {
		width: 100%;
		height: 100%;
	}
</style>